From: Stefano Stabellini Date: Tue, 13 Sep 2011 09:32:24 +0000 (+0100) Subject: xen: if mapping GSIs we run out of pirq < nr_irqs_gsi, use the others X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~9904 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22?a=commitdiff_plain;h=2569814496e2c7e61a06d9ddc48defd28759dd96;p=xen.git xen: if mapping GSIs we run out of pirq < nr_irqs_gsi, use the others PV on HVM guests can have more GSIs than the host, in that case we could run out of pirq < nr_irqs_gsi. When that happens use pirq >= nr_irqs_gsi rather than returning an error. Signed-off-by: Stefano Stabellini Tested-by: Benjamin Schweikert --- diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c index 71fea2d74f..9ea29bac76 100644 --- a/xen/arch/x86/irq.c +++ b/xen/arch/x86/irq.c @@ -1646,15 +1646,12 @@ int get_free_pirq(struct domain *d, int type, int index) return i; } } - else - { - for ( i = d->nr_pirqs - 1; i >= nr_irqs_gsi; i-- ) - if ( is_free_pirq(d, pirq_info(d, i)) ) - { - pirq_get_info(d, i); - return i; - } - } + for ( i = d->nr_pirqs - 1; i >= nr_irqs_gsi; i-- ) + if ( is_free_pirq(d, pirq_info(d, i)) ) + { + pirq_get_info(d, i); + return i; + } return -ENOSPC; }